/*
 *Description:
 *User:laoHu
 *Created with Intellij IDEA 2025
 *Data:2025.08.17
 *Time:21:00
 */
public class ListNode {


    //获取倒数第N个数值
    public static void main(String[] args) {

        SingleNode head = new SingleNode();
        head.firstAddNode(1);
        head.firstAddNode(2);
        head.firstAddNode(3);
        head.firstAddNode(7);
        head.firstAddNode(5);

        head.display();
//        //获取倒数第k个元素
//        System.out.println(head.last_K_Node(1));
//        System.out.println(head.last_K_Node(2));
//        System.out.println(head.last_K_Node(3));

    }

    public static void main1(String[] args) {
        SingleNode head = new SingleNode();
        head.firstAddNode(1);
        head.firstAddNode(2);
        head.firstAddNode(3);
        head.firstAddNode(7);
        head.firstAddNode(5);

        SingleNode newHead = head.partition(6);
        System.out.println(newHead);
        //System.out.println(newHead);
    }
}